<template>
  <el-upload
    v-model:file-list="fileList"
    class="upload-demo"
    :action="uploadFileAction"
    :headers="{
        Authorization
    }"
    multiple
    :limit="3"
    name="files"
    :data="data"
    :auto-upload="false"
  >
    <el-button type="primary">点击上传文件</el-button>
    <template #tip>
      <div class="el-upload__tip">
        最多可传3个文件
      </div>
    </template>
  </el-upload>
</template>
<script lang="ts" setup>
import { ref } from 'vue'

import { getToken } from '@/composables/auth'

const Authorization = getToken();

defineProps({
    data:Object
})

const fileList = ref([])

const uploadFileAction = "/api/v1/save_files"
</script>